/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author mosipdkara
 */
@Entity
@Table(name = "kimlikdogrulama")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Kimlikdogrulama.findAll", query = "SELECT k FROM Kimlikdogrulama k"),
    @NamedQuery(name = "Kimlikdogrulama.findByKimlikDogrulamaId", query = "SELECT k FROM Kimlikdogrulama k WHERE k.kimlikDogrulamaId = :kimlikDogrulamaId"),
    @NamedQuery(name = "Kimlikdogrulama.findByKullaniciAdi", query = "SELECT k FROM Kimlikdogrulama k WHERE k.kullaniciAdi = :kullaniciAdi"),
    @NamedQuery(name = "Kimlikdogrulama.findBySifre", query = "SELECT k FROM Kimlikdogrulama k WHERE k.sifre = :sifre")})
public class Kimlikdogrulama implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "KimlikDogrulamaId")
    private Integer kimlikDogrulamaId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 145)
    @Column(name = "KullaniciAdi")
    private String kullaniciAdi;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "Sifre")
    private String sifre;
    @JoinColumn(name = "PersonelId", referencedColumnName = "PersonelId")
    @ManyToOne(optional = false)
    private Personel personelId;
    @JoinColumn(name = "YetkiId", referencedColumnName = "YetkilId")
    @ManyToOne(optional = false)
    private Yetki yetkiId;

    public Kimlikdogrulama() {
    }

    public Kimlikdogrulama(Integer kimlikDogrulamaId) {
        this.kimlikDogrulamaId = kimlikDogrulamaId;
    }

    public Kimlikdogrulama(Integer kimlikDogrulamaId, String kullaniciAdi, String sifre) {
        this.kimlikDogrulamaId = kimlikDogrulamaId;
        this.kullaniciAdi = kullaniciAdi;
        this.sifre = sifre;
    }

    public Integer getKimlikDogrulamaId() {
        return kimlikDogrulamaId;
    }

    public void setKimlikDogrulamaId(Integer kimlikDogrulamaId) {
        this.kimlikDogrulamaId = kimlikDogrulamaId;
    }

    public String getKullaniciAdi() {
        return kullaniciAdi;
    }

    public void setKullaniciAdi(String kullaniciAdi) {
        this.kullaniciAdi = kullaniciAdi;
    }

    public String getSifre() {
        return sifre;
    }

    public void setSifre(String sifre) {
        this.sifre = sifre;
    }

    public Personel getPersonelId() {
        return personelId;
    }

    public void setPersonelId(Personel personelId) {
        this.personelId = personelId;
    }

    public Yetki getYetkiId() {
        return yetkiId;
    }

    public void setYetkiId(Yetki yetkiId) {
        this.yetkiId = yetkiId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (kimlikDogrulamaId != null ? kimlikDogrulamaId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Kimlikdogrulama)) {
            return false;
        }
        Kimlikdogrulama other = (Kimlikdogrulama) object;
        if ((this.kimlikDogrulamaId == null && other.kimlikDogrulamaId != null) || (this.kimlikDogrulamaId != null && !this.kimlikDogrulamaId.equals(other.kimlikDogrulamaId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Kimlikdogrulama[ kimlikDogrulamaId=" + kimlikDogrulamaId + " ]";
    }
    
}
